 <template>
    <views class="terrace_administrators_look">
        <terrace-administrators-base
        :type="type"  
        :roles="roles"
        :admin_user_id="admin_user_id"
        >
        </terrace-administrators-base>
    </views>
</template>



<script>
    import TerraceAdministratorsBase from 'components/terrace/terrace_administrators/child_component/child_component/terrace_administrators_base';

export default {
    name: 'TerraceAdministratorsLook',
    data(){
        return  {
            type:0,          //type类型；0：查看、1：新增、2：编辑
            admin_user_id:this.$route.query.admin_user_id,    //管理员ID
            roles:[]         //简易角色列表
        }
    },
    components:{
        TerraceAdministratorsBase
    },
    mounted(){
        this.$setRouteTitle();
        // this.admin_user_id = parseInt(this.$route.query.admin_user_id);
        console.log('admin_user_id_first',this.admin_user_id);
        //新增时，获取简易角色列表
        this.$raxios.post(this.$mapapi.getSimpleRoleList,{}).then(res => {
            if(res.code != 200)    return Promise.reject(res.msg);
            console.log('res', res);
            if(res.data.length == 0)   return Promise.reject('角色列表为空');
            this.roles = res.data;
        }).catch(res => {
            this.$message.error(res);
        });
    }
}
</script>